package org.spidermesh.meshlog.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

/**
 * @PackageName:org.spidermesh.meshlog.config
 * @ClassName:MeshLogConfiguration
 * @Description:
 * @Author:hw
 * @Date:2020-12-3 15:34
 */
// 以组件的方式使用，使用的时候可以直接注入
@Component
// 用来指定properties配置文件中的key前缀
@ConfigurationProperties(prefix = "mesh.meshlog")
// 用来指定配置文件的位置
@PropertySource("classpath:config/meshlog.properties")
public class MeshLogProperties {
    /**
     * mesh log persist type, can set no,file,db
     */
    private String persist;

    /**
     * if persist is file type, file set log file path
     */
    private String file;

    /**
     * log file prefix
     */
    private String prefix;

    public String getPersist() {
        return persist;
    }

    public void setPersist(String persist) {
        this.persist = persist;
    }

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public String getPrefix() { return prefix; }

    public void setPrefix(String prefix) { this.prefix = prefix; }
}
